<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Clipper2Z - ES6 - Example Minkowski</title>
	<script src="../drawPath.js"></script>
</head>
<body>
	<script type="module">
		import Clipper2ZFactory from '../../dist/es/clipper2z.js';

		Clipper2ZFactory().then((Clipper2Z) => {
			initCanvas(500, 500);

			/* C++:
			Path64 pattern = Ellipse(Point64(100,100), 30, 30);
			Path64 path = MakePath({0,0, 200,0, 200,200, 0,200, 0,0});
			Paths64 solution = MinkowskiDiff(pattern, path, true);
			*/

			const { Ellipse64, Point64, MakePath64, MinkowskiDiff64 } = Clipper2Z;
			const pattern = Ellipse64(new Point64(BigInt(100),BigInt(100), BigInt(0)), 30, 30, 0);
			const path = MakePath64([0,0, 200,0, 200,200, 0,200, 0,0]);
			const solution = MinkowskiDiff64(pattern, path, true);

			drawPath(pattern, 'red');
			drawPath(path, 'green');
			drawPaths(solution, 'blue');
		});
	</script>
</body>
</html>
